﻿CREATE TABLE [dbo].[USUARIO_MENU](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[IdUsuario] [int] NOT NULL,
	[IdMenu] [int] NOT NULL,
 CONSTRAINT [PK_dbo.USUARIO_MENU] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  ForeignKey [FK_dbo.USUARIO_MENU_dbo.MENU_IdMenu]    Script Date: 11/17/2014 00:41:42 ******/
ALTER TABLE [dbo].[USUARIO_MENU]  WITH CHECK ADD  CONSTRAINT [FK_dbo.USUARIO_MENU_dbo.MENU_IdMenu] FOREIGN KEY([IdMenu])
REFERENCES [dbo].[MENU] ([ID])
GO

ALTER TABLE [dbo].[USUARIO_MENU] CHECK CONSTRAINT [FK_dbo.USUARIO_MENU_dbo.MENU_IdMenu]
GO
/****** Object:  ForeignKey [FK_dbo.USUARIO_MENU_dbo.USUARIO_IdUsuario]    Script Date: 11/17/2014 00:41:42 ******/
ALTER TABLE [dbo].[USUARIO_MENU]  WITH CHECK ADD  CONSTRAINT [FK_dbo.USUARIO_MENU_dbo.USUARIO_IdUsuario] FOREIGN KEY([IdUsuario])
REFERENCES [dbo].[USUARIO] ([IdTrabajador])
GO

ALTER TABLE [dbo].[USUARIO_MENU] CHECK CONSTRAINT [FK_dbo.USUARIO_MENU_dbo.USUARIO_IdUsuario]
GO
CREATE NONCLUSTERED INDEX [IX_IdMenu] ON [dbo].[USUARIO_MENU] 
(
	[IdMenu] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_IdUsuario] ON [dbo].[USUARIO_MENU] 
(
	[IdUsuario] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]